namespace Sample.Domain
{
    public class ReviewerForReview
    {
        public ReviewerForReview()
        {
        }

        public virtual Person Reviewer { get; private set; }
        public virtual string Feedback { get; private set; }
        public virtual PeerReview Review { get; private set; }

        public static ReviewerForReview Create(Person reviewer, PeerReview review, string comments)
        {
            return new ReviewerForReview
                       {
                           Feedback = comments,
                           Reviewer = reviewer,
                           Review = review
                       };
        }

        public override bool Equals(object obj)
        {
            return this.IsEqual(obj);
        }

        public override int GetHashCode()
        {
            return HashCodeGenerator.GenerateHashCode(Reviewer.Email, Review.Id);
        }
    }
}